From: Giovanni Campagna Date: Sat, 8 Jun 2013 14:03:14 +0000 (+0200) Subject: ScreenShield: properly handle ensureUnlockDialog() failure X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3802 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=99af697cd79ef4e1713948f58b1bdfe40930bbb3;p=gnome-shell.git ScreenShield: properly handle ensureUnlockDialog() failure If that fails (which only ever happens in initial-setup mode, which has no unlock or login dialog), we don't want to go ahead with whatever we were doing. https://bugzilla.gnome.org/show_bug.cgi?id=701848 --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 4e61c1115..89601c0ea 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -583,8 +583,8 @@ const ScreenShield = new Lang.Class({ _liftShield: function(onPrimary, velocity) { if (this._isLocked) { - this._ensureUnlockDialog(onPrimary, true /* allowCancel */); - this._hideLockScreen(true /* animate */, velocity); + if (this._ensureUnlockDialog(onPrimary, true /* allowCancel */)) + this._hideLockScreen(true /* animate */, velocity); } else { this.deactivate(true /* animate */); } @@ -621,9 +621,8 @@ const ScreenShield = new Lang.Class({ if (!isEnter && !(GLib.unichar_isprint(unichar) || symbol == Clutter.KEY_Escape)) return false; - this._ensureUnlockDialog(true, true); - - if (GLib.unichar_isgraph(unichar)) + if (this._ensureUnlockDialog(true, true) && + GLib.unichar_isgraph(unichar)) this._dialog.addCharacter(unichar); this._liftShield(true, 0); @@ -864,8 +863,8 @@ const ScreenShield = new Lang.Class({ this.actor.show(); this._isGreeter = Main.sessionMode.isGreeter; this._isLocked = true; - this._ensureUnlockDialog(true, true); - this._hideLockScreen(false, 0); + if (this._ensureUnlockDialog(true, true)) + this._hideLockScreen(false, 0); }, _hideLockScreenComplete: function() { @@ -915,7 +914,7 @@ const ScreenShield = new Lang.Class({ if (!constructor) { // This session mode has no locking capabilities this.deactivate(true); - return; + return false; } this._dialog = new constructor(this._lockDialogGroup); @@ -927,12 +926,14 @@ const ScreenShield = new Lang.Class({ // by the time we reach this... log('Could not open login dialog: failed to acquire grab'); this.deactivate(true); + return false; } this._dialog.connect('failed', Lang.bind(this, this._onUnlockFailed)); } this._dialog.allowCancel = allowCancel; + return true; }, _onUnlockFailed: function() {